const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 100; i++) content.push({
        id: `id${i}`,
        brandName: `brandName${i}`,
        dealerCode: `dealerCode${i}`,
        dealerName: `dealerName${i}`,
        shortName: `shortName${i}`,
        type: 1,
        submitBeginDay: 12,
        submitEndDay: 20,
        submitNoticeBeginDay: 21,
        submitNoticeEndDay: 22,
        effectiveDate: '2020-01-10T06:35:32.343Z',
        expirationDate: '2020-01-10T06:35:32.343Z',
        rowVersion: 'string',
        options: [
            'update',
            'abandon',
        ]
    });

    res.json({
        message: 'ok',
        payload: {
            content,
            totalElements: 40,
        }
    });
});

router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '001',
            dealerCode: 'dealerCode',
            dealerName: 'dealerName',
            brandCode: 'brandCode',
            brandName: 'brandName',
            type: 1,
            submitBeginDay: 2,
            submitEndDay: 3,
            submitNoticeBeginDay: 4,
            submitNoticeEndDay: 5,
            effectiveDate: '2020-01-10T07:07:56.795Z',
            expirationDate: '2020-01-10T07:07:56.795Z',
            abandonerName: 'abandonerName',
            abandonTime: '2020-01-10T07:07:56.795Z',
            status: 1,
            remark: 'remark',
            options: [
                'update',
                'abandon'
            ],
            rowVersion: 'string',
        },
        totalElements: 40,
    });
});

router.put('/:id/', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});

router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废'
    });
});

router.post('/', (req, res) => {
    res.json({
        message: '新增成功'
    });
});

router.get('/importTemp', (req, res) => {
    res.json({
        message: '导出'
    });
});
router.get('/export/forCurrentUser', (req, res) => {
    res.json({
        message: '导出'
    });
});
router.post('/import', async(req, res) => {
    res.json({
        message: '导入'
    });
});
module.exports = router;
